package org.example.executor;

import org.example.mapping.BoundSql;
import org.example.mapping.MappedStatement;
import org.example.session.ResultHandler;
import org.example.transaction.Transaction;

import java.sql.SQLException;
import java.util.List;

/**
 * @Author: luyg
 * @Date: 2024/12/03/22:46
 * @Description:
 */
public interface Executor {
    ResultHandler NO_RESULT_HANDLER = null;

    <E> List<E> query(MappedStatement mappedStatement, Object parameter, ResultHandler resultHandler, BoundSql boundSql);

    Transaction getTransaction();

    void commit(boolean required) throws SQLException;

    void rollback(boolean required) throws SQLException;

    void close(boolean forceRollback);
}
